home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Power Programmierung 2
/
Power-Programmierung CD 2 (Tewi)(1994).iso
/
c
/
library
/
dos
/
math
/
cmath
/
floor.c
< prev
next >
Encoding:
Amiga
Atari
Commodore
DOS
FM Towns/JPY
Macintosh
Macintosh JP
Macintosh to JP
NeXTSTEP
RISC OS/Acorn
Shift JIS
UTF-8
Wrap
Text File
|
1983-07-02
|
338 b
|
31 lines
/*
* floor and ceil-- greatest integer <= arg
* (resp least >=)
*/
double modf();
double
floor(d)
double d;
{
double fract;
if (d<0.0) {
d = -d;
fract = modf(d, &d);
if (fract != 0.0)
d += 1;
d = -d;
} else
modf(d, &d);
return(d);
}
double
ceil(d)
double d;
{
return(-floor(-d));
}